/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.biodas.jdas.creators;

import java.util.List;
import org.biodas.jdas.schema.types.*;

/**
 * class to help create types JDAS objects for writing manipulating and writing DAS from scratch
 * @author jw12
 */
public class CreateTypes {
    
    ObjectFactory factory=new ObjectFactory();
    
    public DASTYPES createDASTYPES(List<Object> segments, String href){
		
		DASTYPES types = factory.createDASTYPES();
                GFF gff=factory.createGFF();
                gff.setHref(href);
                types.setGFF(gff);
                
		for(Object segment: segments){
			gff.getSEGMENTOrERRORSEGMENTOrUNKNOWNSEGMENT().add(segment);
		}
		
		return types;
		
	} 
    
    public TYPE createType(String id, String cvId, String category, String description, String count){
        TYPE type=factory.createTYPE();
        type.setId(id);
        type.setCvId(cvId);
        type.setCategory(category);
        type.setDescription(description);
        type.setValue(count);
        return type;
    }
    
    public SEGMENT createSegment(String id, String label, String version, String start, String stop){
        SEGMENT segment=factory.createSEGMENT();
        segment.setId(id);
        segment.setLabel(label);
        segment.setVersion(version);
        segment.setStart(start);
        segment.setStop(stop);
        return segment;
    }
    
}
